package com.gxitsky.utils;

import org.springframework.util.Assert;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author gxing
 * @desc 数值工具类
 * @date 2021/5/8
 */
public class NumericUtil {

    /**
     * @desc: 判断字符串是否为数字
     * @param: [param]
     * @author: gxing
     * @date: 2021/5/8
     */
    public static boolean isNumeric(String param) {
        Assert.notNull(param, "-----> param cant`t be empty");
        Pattern pattern = Pattern.compile("[0-9]*");
        Matcher isNum = pattern.matcher(param);
        return isNum.matches();
    }
}
